< previous page page_191 next page >

Page 191
(table continued from previous page)
SuffixUsageExample
GetRetrieves the value of something on another formStatusGet
SetSets the value of something on another formStatusSet
CheckChecks the data the user typed inFormCheck
ClearClears the controls on a form to a default stateFormClear
LoadLoads a combo or list boxcboStateLoad
KillKills module-level variablesFormKill

The reason for this naming standard is to follow the object and event paradigm that has already been set in Visual Basic. Additionally, Visual Basic sorts the procedure names in the Procedure combo box alphabetically. By naming everything with an object name first, all the procedures for one object show up in one place.
Visual Basic events always start with the object name, followed by an underscore, and then the event. The object is a noun, and the event is a verb or action. Follow this naming standard for your own functions.
9f31265bb40b592b1929e18a47ab28e5.gif
NOTE
Microsoft formerly used the verb first, followed by the noun. This was the reverse of object-oriented standards as well as Microsofts own way of naming event procedures. The company has since changed its way of doing this.
Summary
This chapter introduced you to the use of your own custom procedures and functions. You learned to create procedures and functions both with and without arguments. You also learned the difference between ByVal and ByRef. (Remember to always use ByVal unless you need to return more than one value from a function.)
Review Questions
1. True or False? You may use a letter or underscore as the first character for a procedure name.
2. Whats the file extension used for code modules?

 
< previous page page_191 next page >

If you like this book, buy it!